/******************************************************************************
 * * ui_inter_msg_interface.h - interface for internal message handling
 *
 * *(C) Copyright 2019 ASR International Ltd.
 * * All Rights Reserved
 * ******************************************************************************/
#ifndef UI_INTER_MSG_INTERFACE_H
#define UI_INTER_MSG_INTERFACE_H

#ifdef __cplusplus
extern "C" {
#endif

#include "ui_type.h"    
#include "ui_global.h"
    
enum {
    UI_MSG_FRAMEWORK_BASE            = 0,
// UI_MSG_FRAMEWORK_MSG0 = UI_MSG_FRAMEWORK_BASE,
// UI_MSG_FRAMEWORK_MSG1,
// UI_MSG_FRAMEWORK_MSG2,
    UI_MSG_CALL_BASE                 = 0x100,
// UI_MSG_CALL_MSG0 = UI_MSG_CALL_BASE,
// UI_MSG_CALL_MSG1,
// UI_MSG_CALL_MSG2,
    UI_MSG_CALL_FRAMEWORK_BASE       = 0x200,
    UI_MSG_CALLLOG_FRAMEWORK_BASE    = 0x300,
    UI_MSG_CONTACTS_BASE             = 0x400,
    UI_MSG_FRMEWORK_ALARM_BASE       = 0x500,
    UI_MSG_FRAMEWORK_CALCULATOR_BASE = 0x600,
    UI_MSG_FRAMEWORK_CALENDAR_BASE   = 0x700,
    UI_MSG_FRAMEWORK_SMS_BASE        = 0x800,
    UI_MSG_SETTING_BASE              = 0x900,
    UI_MSG_MMI_MODEMADP_BASE         = 0xA00,
    UI_MSG_ALARM_CALENDAR_BASE       = 0xB00,
    UI_MSG_ALARM_BASE                = 0xC00,
    UI_MSG_CALENDAR_BASE             = 0xD00,
    UI_MSG_MODEM_ADP_BASE            = 0xE00,
    UI_MSG_APP_ADP_BASE              = 0xF00,
};
typedef UINT16   UI_INTER_MSG_ID;

// extern Ui_Msg_Handler_t UiMsgHandler[UI_SUB_MODULE_NUM];
typedef VOID     UI_Inter_Msg_t;

typedef struct
{
    UINT16 MsgId;
} UI_Inter_Msg_Header_t;

typedef struct
{
    UI_Inter_Msg_Header_t MsgHeader;
    UI_Inter_Msg_t *pMsg;
} UI_Os_Msg_t;

typedef VOID (*UI_Msg_Handler_t)(UI_INTER_MSG_ID MsgId, UI_Inter_Msg_t *Msg);                      // message handler call back function define

extern VOID UI_Msg_Handler_Bind(UI_Msg_Handler_t MsgHandler);
extern VOID UI_Send_Inter_Msg(UI_SUB_MODULE_ID Dest, UI_INTER_MSG_ID MsgId, UI_Inter_Msg_t *Msg);
extern UI_Os_Msg_t *UI_Rcv_Inter_Msg(VOID);

#ifdef __cplusplus
}
#endif
#endif
